import type { ComponentInternalInstance } from "vue";

export interface MessageProps {
  message?: string; // 提示内容
  duration?: number; // 时长
  showClose?: boolean; // 是否显示关闭按钮
  type?: "success" | "warning" | "info" | "error"; // 类型
  onDestroy: () => void;
  offset?: number; // 偏移量
  id: string; // 辨别不同的实例
}

export type CreateMessageProps = Omit<MessageProps, "onDestroy" | "id">;

// 组件实例
export interface MessageContext {
  id: string; // 辨别不同的实例
  vnode: VNode;
  props: MessageProps;
  vm: ComponentInternalInstance;
}
